FROM python:3.11.4-slim-buster

WORKDIR /ppyy

LABEL author="Wshape1"

COPY requirements.txt ./

RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

COPY . .

ENV SERVER_PORT=8080 \
    SERVER_HOST=0.0.0.0 \
    MYSQL_HOST=127.0.0.1 \
    MYSQL_PORT=3306 \
    MYSQL_USER=root \
    MYSQL_PASSWORD=root \
    MYSQL_DB=weather_show

CMD python app.py --server.port=$SERVER_PORT --server.host=$SERVER_HOST --mysql.host=$MYSQL_HOST --mysql.port=$MYSQL_PORT --mysql.user=$MYSQL_USER --mysql.password=$MYSQL_PASSWORD --mysql.db=$MYSQL_DB
